# Copyright (c) 2021-2022 Huawei Device Co., Ltd.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

add_subdirectory(tooling)
add_subdirectory(common)
add_subdirectory(napi)
add_subdirectory(mem)
add_subdirectory(irtoc)

## for performance consideration, each test suite should not be oversize, neither too small ##
## the principle is make a solo suite for case over 1000 lines  ##
set(ECMASCRIPT_TESTS_SOURCES
    common/name_dictionary_test.cpp
    common/native_pointer_test.cpp
    common/object_factory_test.cpp
    common/linked_hash_table_test.cpp
    common/large_object_test.cpp
    common/glue_regs_test.cpp
    common/test_helper.cpp
)

set(ECMASCRIPT_TEST_SOURCES-2
    #common/concurrent_sweep_test.cpp
    #common/weak_ref_gen_gc_test.cpp
    #common/weak_ref_stw_gc_test.cpp
    common/ecma_module_test.cpp
    common/ecma_string_test.cpp
    common/huge_object_test.cpp
    common/js_arguments_test.cpp
    common/js_array_iterator_test.cpp
    common/js_dataview_test.cpp
    #common/js_serializer_test.cpp
    common/js_set_iterator_test.cpp
    common/js_symbol_test.cpp
    common/js_typed_array_test.cpp
    common/lexical_env_test.cpp
    common/symbol_table_test.cpp
    common/test_helper.cpp
)

set(ECMASCRIPT_TAGGEDVALUE_TESTS_SOURCES
    common/tagged_value_test.cpp
    common/test_helper.cpp
)

set(ECMASCRIPT_BUILTINS_BASIC_TESTS_SOURCES
    common/builtins_test.cpp
    builtins/builtins_bigint_test.cpp
    builtins/builtins_boolean_test.cpp
    builtins/builtins_symbol_test.cpp
    builtins/builtins_set_test.cpp
    builtins/builtins_map_test.cpp
    builtins/builtins_weak_map_test.cpp
    builtins/builtins_weak_set_test.cpp
    builtins/builtins_iterator_test.cpp
    builtins/builtins_proxy_test.cpp
    common/test_helper.cpp
)

set(ECMASCRIPT_BUILTINS_BASIC_TESTS_SOURCES-1
    builtins/builtins_function_test.cpp
    builtins/builtins_number_test.cpp
    common/test_helper.cpp
)

set(ECMASCRIPT_BUILTINS_REGEXP_TESTS
    builtins/builtins_regexp_test.cpp
    common/test_helper.cpp
)

set(ECMASCRIPT_BUILTINS_OBJECT_TESTS_SOURCES
    builtins/builtins_object_test.cpp
    common/test_helper.cpp
)

set(ECMASCRIPT_BUILTINS_ERRORS_TESTS_SOURCES
    builtins/builtins_errors_test.cpp
    common/test_helper.cpp
)

set(ECMASCRIPT_BUILTINS_DATE_SOURCES
    builtins/builtins_date_test.cpp
    common/test_helper.cpp
)

set(ECMASCRIPT_ES_BASIC_TESTS_SOURCES
    common/js_function_test.cpp
    common/js_date_test.cpp
    common/js_array_test.cpp
    common/js_primitive_ref_test.cpp
    common/test_helper.cpp
)

set(ECMASCRIPT_ES_BASIC_TESTS_SOURCES-1
    common/js_proxy_test.cpp
    common/test_helper.cpp
)

set(ECMASCRIPT_ES_BASIC_TESTS_SOURCES-2
    common/js_set_test.cpp
    common/js_map_test.cpp
    common/js_tagged_queue_test.cpp
    common/js_forin_iterator_test.cpp
    common/js_handle_test.cpp
    common/js_iterator_test.cpp
    common/js_promise_test.cpp
    common/test_helper.cpp
)

set(ECMASCRIPT_ES_BASIC_OBJECT_TESTS_SOURCES
    common/js_object_test.cpp
    common/test_helper.cpp
)

set(ECMASCRIPT_BUILTINS_MATH_TESTS_SOURCES
    builtins/builtins_math_test.cpp
    common/test_helper.cpp
)

set(ECMASCRIPT_BUILTINS_PROMISE_TESTS_SOURCES
    builtins/builtins_promise_test.cpp
    common/test_helper.cpp
)

set(ECMASCRIPT_BUILTINS_JSON_TESTS_SOURCES
    builtins/builtins_json_test.cpp
    common/test_helper.cpp
)

set(ECMASCRIPT_BUILTINS_STRING_TESTS_SOURCES
    builtins/builtins_string_test.cpp
    common/test_helper.cpp
)

set(ECMASCRIPT_BUILTINS_ARRAY_TESTS_SOURCES
    builtins/builtins_array_test.cpp
    common/test_helper.cpp
)

set(ECMASCRIPT_BUILTINS_REFLECT_TESTS_SOURCES
    builtins/builtins_reflect_test.cpp
    common/test_helper.cpp
)

set(ECMASCRIPT_BUILTINS_ARRAYBUFFER_TESTS_SOURCES
    builtins/builtins_arraybuffer_test.cpp
    common/test_helper.cpp
)

set(ECMASCRIPT_BUILTINS_DATAVIEW_TESTS_SOURCES
    builtins/builtins_dataview_test.cpp
    common/test_helper.cpp
)

set(ECMASCRIPT_REGEXP_TESTS_SOURCES
    regexp/regexp_test.cpp
    common/test_helper.cpp)

set(ECMASCRIPT_BUILTINS_TYPEDARRAY_TESTS_SOURCES
    builtins/builtins_typedarray_test.cpp
    common/test_helper.cpp
)

set(ECMASCRIPT_BUILTINS_GLOBAL_TESTS_SOURCES
    builtins/builtins_global_test.cpp
    common/test_helper.cpp
)

#0
panda_ecmascript_add_gtest(
    NO_CORES
NAME arkruntime4ecmascript_tests
    SOURCES
        ${ECMASCRIPT_TESTS_SOURCES}
    LIBRARIES
        arkruntime arkassembler
    INCLUDE_DIRS
        ${PANDA_ECMASCRIPT_PLUGIN_SOURCE}/tests/runtime/common
    SANITIZERS
        ${PANDA_SANITIZERS_LIST}
)
if(TARGET arkruntime4ecmascript_tests)
    panda_target_include_directories(arkruntime4ecmascript_tests
        PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}
    )
    panda_target_compile_options(arkruntime4ecmascript_tests PUBLIC "-Wno-ignored-attributes")
endif()
#1
panda_ecmascript_add_gtest(
    NO_CORES
NAME arkruntime4ecmascript_taggedvalue_tests
    SOURCES
        ${ECMASCRIPT_TAGGEDVALUE_TESTS_SOURCES}
    LIBRARIES
        arkruntime arkassembler
    INCLUDE_DIRS
        ${PANDA_ECMASCRIPT_PLUGIN_SOURCE}/tests/runtime/common
    SANITIZERS
        ${PANDA_SANITIZERS_LIST}
)
if(TARGET arkruntime4ecmascript_taggedvalue_tests)
    panda_target_include_directories(arkruntime4ecmascript_taggedvalue_tests
        PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}
    )
    panda_target_compile_options(arkruntime4ecmascript_taggedvalue_tests PUBLIC "-Wno-ignored-attributes")
endif()
#2
panda_ecmascript_add_gtest(
    NO_CORES
NAME arkruntime4ecmascript_builtins_basic_tests
    SOURCES
        ${ECMASCRIPT_BUILTINS_BASIC_TESTS_SOURCES}
    LIBRARIES
        arkruntime arkassembler
    INCLUDE_DIRS
        ${PANDA_ECMASCRIPT_PLUGIN_SOURCE}/tests/runtime/common
    SANITIZERS
        ${PANDA_SANITIZERS_LIST}
)
if(TARGET arkruntime4ecmascript_builtins_basic_tests)
    panda_target_include_directories(arkruntime4ecmascript_builtins_basic_tests
        PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}
    )
    panda_target_compile_options(arkruntime4ecmascript_builtins_basic_tests PUBLIC "-Wno-ignored-attributes" "-DICU_PATH=\"${ICU_ROOT}/ohos_icu4j/data\"")
endif()
#3.1
panda_ecmascript_add_gtest(
    NO_CORES
NAME arkruntime4ecmascript_builtins_regexp_tests
    SOURCES
        ${ECMASCRIPT_BUILTINS_REGEXP_TESTS}
    LIBRARIES
        arkruntime arkassembler
    INCLUDE_DIRS
        ${PANDA_ECMASCRIPT_PLUGIN_SOURCE}/tests/runtime/common
    SANITIZERS
        ${PANDA_SANITIZERS_LIST}
)
if(TARGET arkruntime4ecmascript_builtins_regexp_tests)
    panda_target_include_directories(arkruntime4ecmascript_builtins_regexp_tests
        PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}
    )
    panda_target_compile_options(arkruntime4ecmascript_builtins_regexp_tests PUBLIC "-Wno-ignored-attributes")
endif()
#3.2
panda_ecmascript_add_gtest(
    NO_CORES
NAME arkruntime4ecmascript_builtins_basic_tests-1
    SOURCES
        ${ECMASCRIPT_BUILTINS_BASIC_TESTS_SOURCES-1}
    LIBRARIES
        arkruntime arkassembler
    INCLUDE_DIRS
        ${PANDA_ECMASCRIPT_PLUGIN_SOURCE}/tests/runtime/common
    SANITIZERS
        ${PANDA_SANITIZERS_LIST}
)
if(TARGET arkruntime4ecmascript_builtins_basic_tests-1)
    panda_target_include_directories(arkruntime4ecmascript_builtins_basic_tests-1
        PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}
    )
    panda_target_compile_options(arkruntime4ecmascript_builtins_basic_tests-1 PUBLIC "-Wno-ignored-attributes")
endif()
#4
panda_ecmascript_add_gtest(
    NO_CORES
NAME arkruntime4ecmascript_builtins_object_tests
    SOURCES
        ${ECMASCRIPT_BUILTINS_OBJECT_TESTS_SOURCES}
    LIBRARIES
        arkruntime arkassembler
    INCLUDE_DIRS
        ${PANDA_ECMASCRIPT_PLUGIN_SOURCE}/tests/runtime/common
    SANITIZERS
        ${PANDA_SANITIZERS_LIST}
)
if(TARGET arkruntime4ecmascript_builtins_object_tests)
    panda_target_include_directories(arkruntime4ecmascript_builtins_object_tests
        PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}
    )
    panda_target_compile_options(arkruntime4ecmascript_builtins_object_tests PUBLIC "-Wno-ignored-attributes")
endif()
#5
panda_ecmascript_add_gtest(
    NO_CORES
NAME arkruntime4ecmascript_builtins_errors_tests
    SOURCES
        ${ECMASCRIPT_BUILTINS_ERRORS_TESTS_SOURCES}
    LIBRARIES
        arkruntime arkassembler
    INCLUDE_DIRS
        ${PANDA_ECMASCRIPT_PLUGIN_SOURCE}/tests/runtime/common
    SANITIZERS
        ${PANDA_SANITIZERS_LIST}
)
if(TARGET arkruntime4ecmascript_builtins_errors_tests)
    panda_target_include_directories(arkruntime4ecmascript_builtins_errors_tests
        PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}
    )
    panda_target_compile_options(arkruntime4ecmascript_builtins_errors_tests PUBLIC "-Wno-ignored-attributes")
endif()
#6
panda_ecmascript_add_gtest(
    NO_CORES
NAME arkruntime4ecmascript_builtins_date_tests
    SOURCES
        ${ECMASCRIPT_BUILTINS_DATE_SOURCES}
    LIBRARIES
        arkruntime arkassembler
    INCLUDE_DIRS
        ${PANDA_ECMASCRIPT_PLUGIN_SOURCE}/tests/runtime/common
    SANITIZERS
        ${PANDA_SANITIZERS_LIST}
)
if(TARGET arkruntime4ecmascript_builtins_date_tests)
    panda_target_include_directories(arkruntime4ecmascript_builtins_date_tests
        PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}
    )
    panda_target_compile_options(arkruntime4ecmascript_builtins_date_tests PUBLIC "-Wno-ignored-attributes")
endif()
#7
panda_ecmascript_add_gtest(
    NO_CORES
NAME arkruntime4ecmascript_es_basic_tests
    SOURCES
        ${ECMASCRIPT_ES_BASIC_TESTS_SOURCES}
    LIBRARIES
        arkruntime arkassembler
    INCLUDE_DIRS
        ${PANDA_ECMASCRIPT_PLUGIN_SOURCE}/tests/runtime/common
    SANITIZERS
        ${PANDA_SANITIZERS_LIST}
)
if(TARGET arkruntime4ecmascript_es_basic_tests)
    panda_target_include_directories(arkruntime4ecmascript_es_basic_tests
        PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}
    )
    panda_target_compile_options(arkruntime4ecmascript_es_basic_tests PUBLIC "-Wno-ignored-attributes")
endif()
#7.1
panda_ecmascript_add_gtest(
    NO_CORES
NAME arkruntime4ecmascript_es_basic_tests-1
    SOURCES
        ${ECMASCRIPT_ES_BASIC_TESTS_SOURCES-1}
    LIBRARIES
        arkruntime arkassembler
    INCLUDE_DIRS
        ${PANDA_ECMASCRIPT_PLUGIN_SOURCE}/tests/runtime/common
    SANITIZERS
        ${PANDA_SANITIZERS_LIST}
)
if(TARGET arkruntime4ecmascript_es_basic_tests-1)
    panda_target_include_directories(arkruntime4ecmascript_es_basic_tests-1
        PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}
    )
    panda_target_compile_options(arkruntime4ecmascript_es_basic_tests-1 PUBLIC "-Wno-ignored-attributes")
endif()
#7.2
panda_ecmascript_add_gtest(
    NO_CORES
NAME arkruntime4ecmascript_es_basic_tests-2
    SOURCES
        ${ECMASCRIPT_ES_BASIC_TESTS_SOURCES-2}
    LIBRARIES
        arkruntime arkassembler
    INCLUDE_DIRS
        ${PANDA_ECMASCRIPT_PLUGIN_SOURCE}/tests/runtime/common
    SANITIZERS
        ${PANDA_SANITIZERS_LIST}
)
if(TARGET arkruntime4ecmascript_es_basic_tests-2)
    panda_target_include_directories(arkruntime4ecmascript_es_basic_tests-2
        PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}
    )
    panda_target_compile_options(arkruntime4ecmascript_es_basic_tests-2 PUBLIC "-Wno-ignored-attributes")
endif()
#8
panda_ecmascript_add_gtest(
    NO_CORES
NAME arkruntime4ecmascript_es_basic_object_tests
    SOURCES
        ${ECMASCRIPT_ES_BASIC_OBJECT_TESTS_SOURCES}
    LIBRARIES
        arkruntime arkassembler
    INCLUDE_DIRS
        ${PANDA_ECMASCRIPT_PLUGIN_SOURCE}/tests/runtime/common
    SANITIZERS
        ${PANDA_SANITIZERS_LIST}
)
if(TARGET arkruntime4ecmascript_es_basic_object_tests)
    panda_target_include_directories(arkruntime4ecmascript_es_basic_object_tests
        PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}
    )
    panda_target_compile_options(arkruntime4ecmascript_es_basic_object_tests PUBLIC "-Wno-ignored-attributes")
endif()
#9
panda_ecmascript_add_gtest(
    NO_CORES
NAME arkruntime4ecmascript_builtins_math_tests
    SOURCES
${ECMASCRIPT_BUILTINS_MATH_TESTS_SOURCES}
    LIBRARIES
        arkruntime arkassembler
    INCLUDE_DIRS
        ${PANDA_ECMASCRIPT_PLUGIN_SOURCE}/tests/runtime/common
    SANITIZERS
        ${PANDA_SANITIZERS_LIST}
)
if(TARGET arkruntime4ecmascript_builtins_math_tests)
    panda_target_include_directories(arkruntime4ecmascript_builtins_math_tests
        PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}
    )
    panda_target_compile_options(arkruntime4ecmascript_builtins_math_tests PUBLIC "-Wno-ignored-attributes")
endif()
#10
panda_ecmascript_add_gtest(
    NO_CORES
NAME arkruntime4ecmascript_builtins_json_tests
    SOURCES
${ECMASCRIPT_BUILTINS_JSON_TESTS_SOURCES}
    LIBRARIES
        arkruntime arkassembler
    INCLUDE_DIRS
        ${PANDA_ECMASCRIPT_PLUGIN_SOURCE}/tests/runtime/common
    SANITIZERS
        ${PANDA_SANITIZERS_LIST}
)
if(TARGET arkruntime4ecmascript_builtins_json_tests)
    panda_target_include_directories(arkruntime4ecmascript_builtins_json_tests
        PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}
    )
    panda_target_compile_options(arkruntime4ecmascript_builtins_json_tests PUBLIC "-Wno-ignored-attributes")
endif()
#11
panda_ecmascript_add_gtest(
    NO_CORES
    NAME arkruntime4ecmascript_builtins_string_tests
    SOURCES
        ${ECMASCRIPT_BUILTINS_STRING_TESTS_SOURCES}
    LIBRARIES
        arkruntime arkassembler
    INCLUDE_DIRS
        ${PANDA_ECMASCRIPT_PLUGIN_SOURCE}/tests/runtime/common
    SANITIZERS
        ${PANDA_SANITIZERS_LIST}
)
if(TARGET arkruntime4ecmascript_builtins_string_tests)
    panda_target_include_directories(arkruntime4ecmascript_builtins_string_tests
        PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}
    )
    panda_target_compile_options(arkruntime4ecmascript_builtins_string_tests PUBLIC "-Wno-ignored-attributes")
endif()
#12
panda_ecmascript_add_gtest(
    NO_CORES
    NAME arkruntime4ecmascript_builtins_array_tests
    SOURCES
        ${ECMASCRIPT_BUILTINS_ARRAY_TESTS_SOURCES}
    LIBRARIES
        arkruntime arkassembler
    INCLUDE_DIRS
        ${PANDA_ECMASCRIPT_PLUGIN_SOURCE}/tests/runtime/common
    SANITIZERS
        ${PANDA_SANITIZERS_LIST}
)
if(TARGET arkruntime4ecmascript_builtins_array_tests)
    panda_target_include_directories(arkruntime4ecmascript_builtins_array_tests
        PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}
    )
    panda_target_compile_options(arkruntime4ecmascript_builtins_array_tests PUBLIC "-Wno-ignored-attributes")
endif()
#13
panda_ecmascript_add_gtest(
    NO_CORES
    NAME arkruntime4ecmascript_builtins_reflect_tests
    SOURCES
        ${ECMASCRIPT_BUILTINS_REFLECT_TESTS_SOURCES}
    LIBRARIES
        arkruntime arkassembler
    INCLUDE_DIRS
        ${PANDA_ECMASCRIPT_PLUGIN_SOURCE}/tests/runtime/common
    SANITIZERS
        ${PANDA_SANITIZERS_LIST}
)
if(TARGET arkruntime4ecmascript_builtins_reflect_tests)
    panda_target_include_directories(arkruntime4ecmascript_builtins_reflect_tests
        PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}
    )
    panda_target_compile_options(arkruntime4ecmascript_builtins_reflect_tests PUBLIC "-Wno-ignored-attributes")
endif()
#14
panda_ecmascript_add_gtest(
    NO_CORES
    NAME arkruntime4ecmascript_builtins_arraybuffer_tests
    SOURCES
        ${ECMASCRIPT_BUILTINS_ARRAYBUFFER_TESTS_SOURCES}
    LIBRARIES
        arkruntime arkassembler
    INCLUDE_DIRS
        ${PANDA_ECMASCRIPT_PLUGIN_SOURCE}/tests/runtime/common
    SANITIZERS
        ${PANDA_SANITIZERS_LIST}
)
if(TARGET arkruntime4ecmascript_builtins_arraybuffer_tests)
    panda_target_include_directories(arkruntime4ecmascript_builtins_arraybuffer_tests
        PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}
    )
    panda_target_compile_options(arkruntime4ecmascript_builtins_arraybuffer_tests PUBLIC "-Wno-ignored-attributes")
endif()
#15
panda_ecmascript_add_gtest(
    NO_CORES
    NAME arkruntime4ecmascript_regexp_tests
    SOURCES
        ${ECMASCRIPT_REGEXP_TESTS_SOURCES}
    LIBRARIES
        arkruntime arkassembler
    INCLUDE_DIRS
        ${PANDA_ECMASCRIPT_PLUGIN_SOURCE}/tests/runtime/common
    SANITIZERS
        ${PANDA_SANITIZERS_LIST}
)
if(TARGET arkruntime4ecmascript_regexp_tests)
    panda_target_include_directories(arkruntime4ecmascript_regexp_tests
        PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}
    )
    panda_target_compile_options(arkruntime4ecmascript_regexp_tests PUBLIC "-Wno-ignored-attributes")
endif()
#16
panda_ecmascript_add_gtest(
    NO_CORES
    NAME arkruntime4ecmascript_builtins_dataview_tests
    SOURCES
        ${ECMASCRIPT_BUILTINS_DATAVIEW_TESTS_SOURCES}
    LIBRARIES
        arkruntime arkassembler
    INCLUDE_DIRS
        ${PANDA_ECMASCRIPT_PLUGIN_SOURCE}/tests/runtime/common
    SANITIZERS
        ${PANDA_SANITIZERS_LIST}
)
if(TARGET arkruntime4ecmascript_builtins_dataview_tests)
    panda_target_include_directories(arkruntime4ecmascript_builtins_dataview_tests
        PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}
    )
    panda_target_compile_options(arkruntime4ecmascript_builtins_dataview_tests PUBLIC "-Wno-ignored-attributes")
endif()
#17
panda_ecmascript_add_gtest(
    NO_CORES
    NAME arkruntime4ecmascript_builtins_typedarray_tests
    SOURCES
        ${ECMASCRIPT_BUILTINS_TYPEDARRAY_TESTS_SOURCES}
    LIBRARIES
        arkruntime arkassembler
    INCLUDE_DIRS
        ${PANDA_ECMASCRIPT_PLUGIN_SOURCE}/tests/runtime/common
    SANITIZERS
        ${PANDA_SANITIZERS_LIST}
)
if(TARGET arkruntime4ecmascript_builtins_typedarray_tests)
    panda_target_include_directories(arkruntime4ecmascript_builtins_typedarray_tests
        PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}
    )
    panda_target_compile_options(arkruntime4ecmascript_builtins_typedarray_tests PUBLIC "-Wno-ignored-attributes")
endif()
#18
panda_ecmascript_add_gtest(
    NO_CORES
NAME arkruntime4ecmascript_separate_jsvm
    SOURCES
        common/separate_jsvm_test.cpp
    LIBRARIES
        arkruntime arkassembler
    INCLUDE_DIRS
        ${PANDA_ECMASCRIPT_PLUGIN_SOURCE}/tests/runtime/common
    SANITIZERS
        ${PANDA_SANITIZERS_LIST}
)
#19
panda_ecmascript_add_gtest(
    NO_CORES
    NAME arkruntime4ecmascript_mem_tests
    SOURCES
        mem/object_helpers_test.cpp
        mem/g1gc_barrier_test.cpp
    LIBRARIES
        arkruntime arkassembler
    SANITIZERS
        ${PANDA_SANITIZERS_LIST}
    DEPS_TARGETS
        arkstdlib
)
#20
panda_ecmascript_add_gtest(
    NO_CORES
NAME arkruntime4ecmascript_builtins_promise_tests
    SOURCES
${ECMASCRIPT_BUILTINS_PROMISE_TESTS_SOURCES}
    LIBRARIES
        arkruntime arkassembler
    INCLUDE_DIRS
        ${PANDA_ECMASCRIPT_PLUGIN_SOURCE}/tests/runtime/common
    SANITIZERS
        ${PANDA_SANITIZERS_LIST}
)
if(TARGET arkruntime4ecmascript_builtins_promise_tests)
    panda_target_include_directories(arkruntime4ecmascript_builtins_promise_tests
        PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}
    )
    panda_target_compile_options(arkruntime4ecmascript_builtins_promise_tests PUBLIC "-Wno-ignored-attributes")
endif()
#21
panda_ecmascript_add_gtest(
    NO_CORES
NAME arkruntime4ecmascript_tests2
    SOURCES
        ${ECMASCRIPT_TEST_SOURCES-2}
    LIBRARIES
        arkruntime arkassembler
    INCLUDE_DIRS
        ${PANDA_ECMASCRIPT_PLUGIN_SOURCE}/tests/runtime/common
    SANITIZERS
        ${PANDA_SANITIZERS_LIST}
)
if(TARGET arkruntime4ecmascript_tests2)
    panda_target_include_directories(arkruntime4ecmascript_tests2
        PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}
    )
    panda_target_compile_options(arkruntime4ecmascript_tests2 PUBLIC "-Wno-ignored-attributes")
endif()
#22
panda_ecmascript_add_gtest(
    NO_CORES
NAME arkruntime4ecmascript_builtins_global_tests
    SOURCES
        ${ECMASCRIPT_BUILTINS_GLOBAL_TESTS_SOURCES}
    LIBRARIES
        arkruntime arkassembler
    INCLUDE_DIRS
        ${PANDA_ECMASCRIPT_PLUGIN_SOURCE}/tests/runtime/common
    SANITIZERS
        ${PANDA_SANITIZERS_LIST}
)
if(TARGET arkruntime4ecmascript_builtins_global_tests)
    panda_target_include_directories(arkruntime4ecmascript_builtins_global_tests
        PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}
    )
    panda_target_compile_options(arkruntime4ecmascript_builtins_global_tests PUBLIC "-Wno-ignored-attributes")
endif()